<?php
class TimeInterceptor extends Interceptor {
    private $start;
    public function before($context) {
        $this->start = Debugger::getTimeStamp();
    }
    public function after($context) {
        $end = Debugger::getTimeStamp();
        $diff = Debugger::timeDiff($this->start, $end);
        if (false === strstr($context->action, 'ajax'))
        {
            echo "time: $diff ms. <br>";
        }
        //error_log(date('Y-m-d H:i:s').' '.getenv('REQUEST_URI')." $diff \n", 3, '/tmp/time.log');
    }
}
